// API响应基础类型
export interface ApiResponse<T = any> {
  code: number
  msg: string
  data: T
}

// 分页响应类型
export interface PageResponse<T = any> {
  total: number
  rows: T[]
}

// 用户相关类型
export interface BlogUser {
  userId?: number
  username: string
  nickname?: string
  email?: string
  avatar?: string
  bio?: string
  status?: string
  createTime?: string
  updateTime?: string
  loginTime?: string
  loginIp?: string
}

export interface LoginForm {
  username: string
  password: string
}

export interface RegisterForm {
  username: string
  password: string
  confirmPassword: string
  email: string
  nickname?: string
}

// 笔记相关类型
export interface NoteDaily {
  noteId?: number
  title: string
  content: string
  summary?: string
  categoryId?: number
  categoryName?: string
  tags?: string
  isPublic?: string
  viewCount?: number
  likeCount?: number
  favoriteCount?: number
  commentCount?: number
  createBy?: string
  createTime?: string
  updateBy?: string
  updateTime?: string
  attachments?: NoteAttachment[]
}

export interface NoteDocument {
  noteId?: number
  title: string
  content: string
  summary?: string
  categoryId?: number
  categoryName?: string
  tags?: string
  documentType?: string
  isPublic?: string
  viewCount?: number
  likeCount?: number
  favoriteCount?: number
  commentCount?: number
  createBy?: string
  createTime?: string
  updateBy?: string
  updateTime?: string
  attachments?: NoteAttachment[]
}

export interface NoteAttachment {
  attachmentId?: number
  noteId?: number
  fileName: string
  filePath: string
  fileSize?: number
  fileType?: string
  createTime?: string
}

export interface NoteCategory {
  categoryId?: number
  categoryName: string
  parentId?: number
  orderNum?: number
  status?: string
  createTime?: string
}

// 笔记标签类型
export interface NoteLabel {
  labelId: number
  labelName: string
  color: string
}

// 交互相关类型
export interface NoteLike {
  likeId?: number
  noteId: number
  userId: number
  createTime?: string
}

export interface NoteFavorite {
  favoriteId?: number
  noteId: number
  userId: number
  folderName?: string
  createTime?: string
}

export interface NoteComment {
  commentId?: number
  noteId: number
  userId: number
  username?: string
  nickname?: string
  avatar?: string
  content: string
  parentId?: number
  likeCount?: number
  createTime?: string
  children?: NoteComment[]
}

// 查询参数类型
export interface NoteQuery {
  pageNum?: number
  pageSize?: number
  title?: string
  categoryId?: number
  tags?: string
  keyword?: string
  documentType?: string
  labelId?: number
}

export interface CommentQuery {
  pageNum?: number
  pageSize?: number
  noteId: number
  noteType: string
  parentId?: number
}

// 统计信息类型
export interface NoteStats {
  likeCount: number
  favoriteCount: number
  commentCount: number
  isLiked: boolean
  isFavorited: boolean
}